capture scenario where git hooks are overwritten during a running agent prompt#791
Merged
capture scenario where git hooks are overwritten during a running agent prompt#791
Conversation
…nt prompt Entire-Checkpoint: 921759ff3b5f
Contributor
There was a problem hiding this comment.
Pull request overview
Adds an integration test to exercise recovery when Entire-managed git hooks are overwritten mid-turn, validating that a subsequent prompt’s setup re-installs hooks so later commits regain the Entire-Checkpoint trailer.
Changes:
- Added a new integration test that simulates hooks being overwritten mid-turn and verifies trailer presence/absence across commits.
- Verifies EnsureSetup re-installs hooks and creates
.pre-entirebackups when third-party hook content is detected.
gtrrz-victor
previously approved these changes
Mar 27, 2026
Entire-Checkpoint: 68b40bd9d2c6
gtrrz-victor
approved these changes
Apr 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is in context of: #784
It validates the assumption around hooks being overwritten but not the exact scenario described there. In the issue the next prompt fails too but this test shows our restore git hook logic works and recovers for the next prompt.
Note
Low Risk
Low risk: adds an integration test only, but it touches git hook state on disk and could be flaky if the test harness or hook detection changes.
Overview
Adds a new integration test (
hook_overwrite_test.go) that reproduces the issue-784 scenario where third-party tools overwrite managed git hooks mid prompt, causing an intermediate commit to miss the checkpoint trailer.The test then starts a second prompt to assert
EnsureSetupreinstalls hooks (including creating.pre-entirebackups for chaining) and that subsequent commits again include a checkpoint trailer with a new checkpoint ID.Written by Cursor Bugbot for commit 5b4aa6d. Configure here.